package com.myeasyexcel.response;



public enum ExcelCode implements ResultCode {
    TEMPLATE_ROW_NAME_ERROR(false,1102014,"导入表格标题有误，请修改后重新导入"),
    TEMPLATE_ZERO_BYTES(false,1102016,"模板错误，大小为0字节"),
    TEMPLATE_IO_ERROR(false,1102017,"读取文件异常，请查看文件是否正常或稍后重试"),
    FILE_ERROR(false,1102018,"上传文件类型错误，请选择excel文件类型"),
    FILE_WRITE_ERROR(false,1102019,"写出文件异常"),
    GET_FILE_NAME_ERROR(false,1102020,"获取文件名称错误"),
    ;

    private boolean success;
    private int code;
    private String msg;

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.msg;
    }

    @Override
    public String toJsonString() {
        return "{success:" + this.success + ", code:" + this.code + ", msg:'" + this.msg + '\'' + '}';
    }

    private ExcelCode(boolean success, int code, String msg) {
        this.success = success;
        this.code = code;
        this.msg = msg;
    }
}
